package com.hnluchuan.bmjlearning.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.hnluchuan.core.model.BaseModel;

import javax.persistence.ManyToOne;
import com.hnluchuan.bmjlearning.model.ServicePackage;
import java.util.Date;
import com.hnluchuan.bmjlearning.model.User;
import javax.persistence.JoinColumn;
import com.hnluchuan.bmjlearning.model.Customer;
import javax.persistence.FetchType;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 客户的服务包
 */
@Entity
@Table(name = "t_customer_service_package") 
public class CustomerServicePackage extends BaseModel {
	private static final long serialVersionUID = 1L;
	
	public CustomerServicePackage() {
	}
	
	public CustomerServicePackage(Long id) {
		this.id = id;
	}
	
	/**
	 * id
	 */
	@Id
	@GeneratedValue
	@Column(name = "id")
	private Long id;
	/**
	 * 代理商用户
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	private User user;
	/**
	 * 客户
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id")
	private Customer customer;
	/**
	 * 服务包
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "service_package_id")
	private ServicePackage servicePackage;
	/**
	 * 服务包个数
	 */
	@Column(name = "count")    		
	private Integer count;
	/**
	 * 是否删除,0未删除,1已删除
	 */
	@Column(name = "deleted")
	private Integer deleted;
	/**
	 * 创建时间
	 */
	@DateTimeFormat(pattern = "")
	@Column(name = "created")
	private Date created;
	// fields end
	
	/** id */
	public Long getId() {
    	return id;
    }
    /** id */
    public void setId(Long id) {
    	this.id = id;
    }
	/** 代理商用户 */
	public User getUser() {
    	return user;
    }
    /** 代理商用户 */
    public void setUser(User user) {
    	this.user = user;
    }
	/** 客户 */
	public Customer getCustomer() {
    	return customer;
    }
    /** 客户 */
    public void setCustomer(Customer customer) {
    	this.customer = customer;
    }
	/** 服务包 */
	public ServicePackage getServicePackage() {
    	return servicePackage;
    }
    /** 服务包 */
    public void setServicePackage(ServicePackage servicePackage) {
    	this.servicePackage = servicePackage;
    }
	/** 服务包个数 */
	public Integer getCount() {
    	return count;
    }
    /** 服务包个数 */
    public void setCount(Integer count) {
    	this.count = count;
    }

	public Integer getDeleted() {
		return deleted;
	}

	public void setDeleted(Integer deleted) {
		this.deleted = deleted;
	}

	/** 创建时间 */
	public Date getCreated() {
    	return created;
    }
    /** 创建时间 */
    public void setCreated(Date created) {
    	this.created = created;
    }
	
}
